import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: syyyy
 * Date: 2025-07-19
 * Time: 12:18
 */
public class Test {
    public static String divideString(String s){
        int count=0;
        StringBuffer stringBuffer=new StringBuffer();
        for (int i = s.length()-1; i >= 0; i--) {
            char ch=s.charAt(i);
            stringBuffer.append(ch);
            count++;
            if(count==3){
                stringBuffer.append(",");
                count=0;
            }
        }
        String s2=stringBuffer.toString();
        StringBuffer stringBuffer1=new StringBuffer();
        for (int i = s2.length()-1; i >= 0; i--) {
            char ch=s2.charAt(i);
            stringBuffer1.append(ch);
        }

        return stringBuffer1.toString();
    }

    public static int check(String str,String word){
        return str.length() - str.replace(word,"").length();
    }


    public static void main(String[] args) {
//        String s= "hellonowcoder";
//        String ret=divideString(s);
//        System.out.println(ret);
        String string = "H e l l o ! n o w c o d e r";
        Scanner scanner= new Scanner(System.in);
        String word = scanner.next();
        scanner.close();
        System.out.println(check(string, word));



    }
}



